Sunan at-Tirmithiy كتاب الأحكام باب ما جاء فى القاضى كيف يقضى

حَدَّثَنَا هَنَّادٌ حَدَّثَنَا وَكِيعٌ عَنْ شُعْبَةَ عَنْ أَبِى عَوْنٍ الثَّقَفِىِّ عَنِ الْحَارِثِ بْنِ عَمْرٍو عَنْ رِجَالٍ مِنْ أَصْحَابِ مُعَاذٍ عَنْ مُعَاذٍ أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم بَعَثَ مُعَاذًا إِلَى الْيَمَنِ فَقَالَ كَيْفَ تَقْضِى. فَقَالَ أَقْضِى بِمَا فِى كِتَابِ اللَّهِ. قَالَ فَإِنْ لَمْ يَكُنْ فِى كِتَابِ اللَّهِ. قَالَ فَبِسُنَّةِ رَسُولِ اللَّهِ صلى الله عليه وسلم. قَالَ فَإِنْ لَمْ يَكُنْ فِى سُنَّةِ رَسُولِ اللَّهِ صلى الله عليه وسلم. قَالَ أَجْتَهِدُ رَأْيِى. قَالَ الْحَمْدُ لِلَّهِ الَّذِى وَفَّقَ رَسُولَ رَسُولِ اللَّهِ صلى الله عليه وسلم.
The Messenger of God, peace and blessings of God be upon him, sent Mu'āth [Ibn Jabal] to [rule over] Yemen, and asked him, "How will you judge?" Mu'āth answered, "In accordance with the Book of God." He then asked, "And what if [the ruling] is not in the Book of God?" Mu'āth replied, "Then in accordance with the sunnah (1) of the Messenger of God, peace and blessings of God be upon him." He said, "And what if it is not in the sunnah of the Messenger of God?" "Then I would exert myself in juristic deduction," Mu'āth responded. At that, the Messenger of God said, "Praise be to God, who guided the messenger of the Messenger of God, peace and blessings of God be upon him, to that which is correct." Footnote: (1): Record of the tradition of prophet Muḥammad, peace and blessings of God be upon him, including his sayings, actions, biography, physical and behavioral depiction, and his approval of something said or done in his presence, as narrated by his Companions. And according to this definition, sunnah and ḥadīth are synonymous for ḥadīth scholars. Ḥadīth is considered a major source of religious law, moral guidance and exemplification for Muslims, second only to the Qur’ān. Click on ḥadīth to read more